using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._Utilities
{
    /// <summary>
    /// <para>Calculate Distance Band from Neighbor Count</para>
    /// <para>Returns the minimum, the maximum, and the average distance to the specified Nth nearest neighbor (N is an input parameter) for a set of features.  Results are written as tool execution messages.</para>
    /// <para>返回一组要素到指定第 N 个最近邻（N 是输入参数）的最小值、最大值和平均距离。 结果将写入工具执行消息。</para>
    /// </summary>    
    [DisplayName("Calculate Distance Band from Neighbor Count")]
    public class CalculateDistanceBand : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateDistanceBand()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Features">
        /// <para>Input Features</para>
        /// <para>The feature class or layer used to calculate distance statistics.</para>
        /// <para>用于计算距离统计数据的要素类或图层。</para>
        /// </param>
        /// <param name="_Neighbors">
        /// <para>Neighbors</para>
        /// <para>The number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window.</para>
        /// <para>要为每个要素考虑的邻居数 （N）。此数字应为 1 与要素类中要素总数之间的任意整数。将编译每个要素与其第 N 个相邻要素之间的距离列表，并将最大、最小和平均距离输出到结果 窗口。</para>
        /// </param>
        /// <param name="_Distance_Method">
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how distances are calculated from each feature to neighboring features.</para>
        ///   <bulletList>
        ///     <bullet_item>Euclidean—The straight-line distance between two points (as the crow flies)</bullet_item><para/>
        ///     <bullet_item>Manhattan—The distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-coordinates</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何计算从每个要素到相邻要素的距离。</para>
        ///   <bulletList>
        ///     <bullet_item>欧几里得 - 两点之间的直线距离（乌鸦飞翔时）</bullet_item><para/>
        ///     <bullet_item>曼哈顿 - 沿直角轴测量的两点之间的距离（城市街区）;通过将 x 坐标和 y 坐标之间的（绝对）差求和计算得出</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public CalculateDistanceBand(object _Input_Features, long _Neighbors, _Distance_Method_value _Distance_Method)
        {
            this._Input_Features = _Input_Features;
            this._Neighbors = _Neighbors;
            this._Distance_Method = _Distance_Method;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Calculate Distance Band from Neighbor Count";

        public override string CallName => "stats.CalculateDistanceBand";

        public override List<string> AcceptEnvironments => ["geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Features, _Neighbors, _Distance_Method.GetGPValue(), _Minimum_Distance, _Average_Distance, _Maximum_Distance];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The feature class or layer used to calculate distance statistics.</para>
        /// <para>用于计算距离统计数据的要素类或图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Features { get; set; }


        /// <summary>
        /// <para>Neighbors</para>
        /// <para>The number of neighbors (N) to consider for each feature. This number should be any integer between one and the total number of features in the feature class. A list of distances between each feature and its Nth neighbor is compiled, and the maximum, minimum, and average distances are output to the Results window.</para>
        /// <para>要为每个要素考虑的邻居数 （N）。此数字应为 1 与要素类中要素总数之间的任意整数。将编译每个要素与其第 N 个相邻要素之间的距离列表，并将最大、最小和平均距离输出到结果 窗口。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Neighbors")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long _Neighbors { get; set; }


        /// <summary>
        /// <para>Distance Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how distances are calculated from each feature to neighboring features.</para>
        ///   <bulletList>
        ///     <bullet_item>Euclidean—The straight-line distance between two points (as the crow flies)</bullet_item><para/>
        ///     <bullet_item>Manhattan—The distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-coordinates</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何计算从每个要素到相邻要素的距离。</para>
        ///   <bulletList>
        ///     <bullet_item>欧几里得 - 两点之间的直线距离（乌鸦飞翔时）</bullet_item><para/>
        ///     <bullet_item>曼哈顿 - 沿直角轴测量的两点之间的距离（城市街区）;通过将 x 坐标和 y 坐标之间的（绝对）差求和计算得出</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _Distance_Method_value _Distance_Method { get; set; }

        public enum _Distance_Method_value
        {
            /// <summary>
            /// <para>Euclidean</para>
            /// <para>Euclidean—The straight-line distance between two points (as the crow flies)</para>
            /// <para>欧几里得 - 两点之间的直线距离（乌鸦飞翔时）</para>
            /// </summary>
            [Description("Euclidean")]
            [GPEnumValue("EUCLIDEAN_DISTANCE")]
            _EUCLIDEAN_DISTANCE,

            /// <summary>
            /// <para>Manhattan</para>
            /// <para>Manhattan—The distance between two points measured along axes at right angles (city block); calculated by summing the (absolute) difference between the x- and y-coordinates</para>
            /// <para>曼哈顿 - 沿直角轴测量的两点之间的距离（城市街区）;通过将 x 坐标和 y 坐标之间的（绝对）差求和计算得出</para>
            /// </summary>
            [Description("Manhattan")]
            [GPEnumValue("MANHATTAN_DISTANCE")]
            _MANHATTAN_DISTANCE,

        }

        /// <summary>
        /// <para>Minimum Distance</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Distance")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _Minimum_Distance { get; set; }


        /// <summary>
        /// <para>Average Distance</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Average Distance")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _Average_Distance { get; set; }


        /// <summary>
        /// <para>Maximum Distance</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Distance")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _Maximum_Distance { get; set; }


        public CalculateDistanceBand SetEnv(object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}